import React, { useState } from "react";
import { Input, Select } from "antd";
const { Option } = Select;
const { Search } = Input;
function SearchElement(props) {
    const [type, setType] = useState("name");
    const handleClick = (value) => {
        props.show({ type, value });
    };
    return (
        <div>
            <Input.Group compact>
                <Select
                    defaultValue="name"
                    onChange={(value) => setType(value)}
                >
                    <Option value="name">姓名</Option>
                    <Option value="age">年龄</Option>
                    <Option value="gender">性别</Option>
                </Select>
                <Search
                    placeholder="请输入搜索值"
                    style={{ width: "80%" }}
                    enterButton
                    onSearch={handleClick}
                />
            </Input.Group>
        </div>
    );
}
export default SearchElement;
